#!/bin/sed -f
#
# This is a helper script which can be run to apply local customisations
# to the SVN osm.xml file without having to manually merge local
# paths, database params etc each time the file is updated
#
# First customize this file with your local details, then:
#
# $ ./convert osm.xml > osm-local.xml
#
#


# replace the server with the local postgis database
# <Parameter name="host">dev.openstreetmap.org</Parameter>
s|<Parameter name="host">dev.openstreetmap.org</Parameter>|<Parameter name="host">/var/run/postgresql</Parameter>|

#      <Parameter name="host">dev.openstreetmap.org</Parameter>
#  s/dev\.openstreetmap\.org/localhost/

# Since we normally run on localhost; we can delete these lines
#      <Parameter name="port">5433</Parameter>     
/<Parameter name="port">5433<\/Parameter>/d
/<Parameter name="port">5432<\/Parameter>/d



#      <Parameter name="user">steve</Parameter>
s/"user">steve/"user">jburges/
s/"user">artem/"user">jburges/

# If I connect to a local socket i don't need any username
# This only works with the newest Mapnik 
/<Parameter name="user">steve<\/Parameter>/d

#      <Parameter name="dbname">mapnik</Parameter>
s/"dbname">mapnik/"dbname">gis/
s/"dbname">planet_osm/"dbname">gis/
s/"dbname">steve/"dbname">gis/


#       <Parameter name="file">/Users/artem/world_boundaries/places</Parameter>
s|/Users/artem/world_boundaries/|/home/jburges/osm/data/world_boundaries/|
s|/home/steve/world_boundaries/|/usr/share/mapnik/world_boundaries/|

# PointSymbolizer file="/Users/artem/symbols/recycling.png" type="png" width="20" height="20" />
s|/Users/artem/symbols/|/home/jburges/osm/svn.openstreetmap.org/applications/rendering/mapnik/symbols/|
s|/home/steve/symbols/|/usr/share/mapnik/symbols/|

#/home/jburges/osm/svn.openstreetmap
s|/home/jburges/osm/svn.openstreetmap|/home/jburges/svn.openstreetmap|

# /home/jburges/osm/data/world_boundaries
s|/home/jburges/osm/data/world_boundaries|/home/jburges/osm/world_boundaries|

# bold font fails for me, use this instead
s/DejaVu Sans Bold/DejaVu Sans Book/
